Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed unbound vars and implemented some bash good practices #27

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

na--
Copy link

@na-- na-- commented Dec 9, 2014

The rationalle for changing the first 2 lines can be found here: http://kvz.io/blog/2013/11/21/bash-best-practices/


OUTPUT=

while getopts "hvza:c:e:o:r:u:p:n:" OPTION
while getopts ":hvza:c:e:o:r:u:p:n:" OPTION
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason for this change and the one on line 99 is this (from the getopts manpage): If an option character not contained in the optstring operand is found where an option character is expected, the shell variable specified by name shall be set to the ('?') character. In this case, if the first character in optstring is a (':'), the shell variable OPTARG shall be set to the option character found, but no output shall be written to standard error; otherwise, the shell variable OPTARG shall be unset and a diagnostic message shall be written to standard error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant